import { rest } from './index'
// import md5 from 'js-md5/build/md5.min'

const Api = {
  login: '/api/login',
  managerList: '/api/user/list',
  addManager: '/api/user',
  deleteManager: '/api/user',
  betUserList: '/api/bettingUser/list',
  addBetUser: '/api/bettingUser',
  deleteBetUser: '/api/bettingUser'
}

export default {
  /*
  * 用户登录
  * **/
  login (params) {
    return rest.post(Api.login, params)
  },
  managerList (params) {
    return rest.post(Api.managerList, params)
  },
  addManager (params) {
    return rest.post(Api.addManager, params)
  },
  deleteManager (params) {
    return rest.delete(Api.deleteManager, params)
  },
  /***
   * 投注用户
   * */
  getUserList (params) {
    return rest.post(Api.betUserList, params)
  },
  addBetUser (params) {
    return rest.post(Api.addBetUser, params)
  },
  editBetUser (params) {
    let id = params.id
    delete params.id
    return rest.put(Api.addBetUser, id, params)
  },
  deleteBetUser (params) {
    return rest.delete(Api.deleteBetUser, params)
  }
}
